|
|
|
|
|
|
|
Building the Visual Basic 5 Field Data Types Project |
|
|
|
|
|
|
|
|
The following project illustrates how different Visual Basic data field types store user input. You also see how Visual Basic responds to input that is out of range for the various data field types. |
|
|
|
|
|
|
|
|
1. Begin by creating a new Visual Basic project (select File | New Project). Using Table 2.2 and Figure 2.8 as guides, populate the Visual Basic form. |
|
|
|
|
| |
|
|
|
|
Notice that you are creating a set of four buttons with the same name, but different Index property values. This is a control array. Control arrays offer an excellent way to simplify Visual Basic coding. However, they behave a bit differently than non-arrayed controls. It is important that you build the controls exactly as described in this table. |
|
|
|
|
|
|
|
|
|
|
Figure 2.8.
The form for the Visual Basic
data field types project. |
|
|
|
|
| Table 2.2. Controls for the Visual Basic data field types project. | | Control | Property | Setting | | Project | Name | prjFieldTypes | | Form | Name | frmFieldTypes | | Caption | VB5 Basic Data Field Types | | CommandButton | Name | cmdBtn | | Caption | &Add | | Height | 300 | | Index | 0 | | Width | 1200 |
|
|
|
|
|
|
(table continued on next page) |
|
|
|
|
|